const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const mongoosePaginate = require('mongoose-paginate');
const ObjectId = Schema.ObjectId;


// 定义一个普通的数据模型
var CommentSchema = new mongoose.Schema({    
    userId:ObjectId,
    content:String,
    newsId:ObjectId,
    cateId:ObjectId,    
    date:{type:Date,default: Date.now },
});
// 将数据模型应用分页插件
CommentSchema.plugin(mongoosePaginate);

module.exports = mongoose.model('Comment', CommentSchema,'comment');